package com.dxf.chepter03

object T27_练习 {
  def main(args: Array[String]): Unit = {
    t02()
  }

  def t01(): Unit = {
    var sum: Int = 0
    var count: Int = 0
    //打印1~100之间所有是9的倍数的整数个数及总和
    for (i <- 1 to 100 if i % 9 == 0) {
      sum += i
      println(i)
      count += 1
    }

    println(sum)
    println(count)
  }


  def t02(): Unit = {
    //输出加法表达式
    for (i <- 0 to 6; j = 6 - i) {
      printf("%d + %d = %d\n", i, j, i + j)
    }

  }


}
